package com.seuic.hnjiningposapp.hnapps.ui.view.dialog;

import android.content.Context;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;

import androidx.annotation.NonNull;

import com.lxj.xpopup.core.BasePopupView;
import com.seuic.hnjiningposapp.R;

import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;
import butterknife.Unbinder;

/**
 * 确认活转定信息
 */
public class SureHtoDInfoPp extends BasePopupView {
    Unbinder bind;
    @BindView(R.id.sure_switchinfo_nametv)
    TextView sureSwitchinfoNametv;
    @BindView(R.id.sure_switchinfo_numtext)
    TextView sureSwitchinfoNumtext;
    @BindView(R.id.sure_switchinfo_usernametext)
    TextView sureSwitchinfoUsernametext;
    @BindView(R.id.sure_switchinfo_name)
    TextView sureSwitchinfoName;
    @BindView(R.id.sure_switchinfo_moneytext)
    TextView sureSwitchinfoMoneytext;
    @BindView(R.id.sure_switchinfo_rate)
    TextView sureSwitchinfoRate;
    @BindView(R.id.sure_switchinfo_interest)
    TextView sureSwitchinfoInterest;
    @BindView(R.id.sure_switchinfo_time)
    TextView sureSwitchinfoTime;
    @BindView(R.id.sure_switchinfo_type)
    TextView sureSwitchinfoType;
    @BindView(R.id.sure_switchinfo_nobtn)
    Button sureSwitchinfoNobtn;
    @BindView(R.id.sure_switchinfo_yesbtn)
    Button sureSwitchinfoYesbtn;

    String mBankNum;//卡号
    String mUsername;//用户名
    String mPNmae;//产品名
    String mMoney;//金额
    String mRateOfInterest;//利率、
    String mInterest;//利息
    String mTime;//时间
    String mTag;//转存标志
    OnSureCallHtoDBack mOnSureCallHtoDBack;

    public void setmBankNum(String mBankNum) {
        this.mBankNum = mBankNum;
    }

    public void setmUsername(String mUsername) {
        this.mUsername = mUsername;
    }

    public void setmPNmae(String mPNmae) {
        this.mPNmae = mPNmae;
    }

    public void setmMoney(String mMoney) {
        this.mMoney = mMoney;
    }

    public void setmRateOfInterest(String mRateOfInterest) {
        this.mRateOfInterest = mRateOfInterest;
    }

    public void setmInterest(String mInterest) {
        this.mInterest = mInterest;
    }

    public void setmTime(String mTime) {
        this.mTime = mTime;
    }

    public void setmTag(String mTag) {
        this.mTag = mTag;
    }

    public SureHtoDInfoPp(@NonNull Context context, OnSureCallHtoDBack onSureCallHtoDBack) {
        super(context);
        this.mOnSureCallHtoDBack = onSureCallHtoDBack;
    }

    @Override
    protected void onCreate() {
        bind = ButterKnife.bind(this);
        super.onCreate();
        sureSwitchinfoNumtext.setText(mBankNum);
        sureSwitchinfoUsernametext.setText(mUsername);
        sureSwitchinfoName.setText(mPNmae);
        sureSwitchinfoMoneytext.setText(mMoney);
        sureSwitchinfoRate.setText(mRateOfInterest);//利率
        sureSwitchinfoInterest.setText(mInterest);//利息
        sureSwitchinfoTime.setText(mTime);
        sureSwitchinfoType.setText(mTag);


    }

    @Override
    protected int getPopupLayoutId() {
        return R.layout.suer_htodinfo_layout;
    }

    @OnClick({R.id.sure_switchinfo_nobtn, R.id.sure_switchinfo_yesbtn})
    public void onViewClicked(View view) {
        switch (view.getId()) {
            case R.id.sure_switchinfo_nobtn:
                mOnSureCallHtoDBack.HtoDLastStep();
                break;
            case R.id.sure_switchinfo_yesbtn:
                mOnSureCallHtoDBack.HtoDNext();
                break;
        }
    }

    @Override
    protected void onDismiss() {
        super.onDismiss();
        //注解解绑
        if (bind != null && bind != Unbinder.EMPTY) {
            bind.unbind();
        }
        this.bind = null;
    }

    public interface OnSureCallHtoDBack {
        void HtoDNext();

        void HtoDLastStep();
    }
}
